<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <script>
    	$(function(){
    		var obj  = $("#ta").datagrid("getSelections");
    		 $("#editProvider").form("load",{
    			providerid:obj[0].providerid,
    			providername:obj[0].providername,
    			providerlegal:obj[0].providerlegal,
    			providertel:obj[0].providertel,
    			providercontinue:obj[0].providercontinue
    			
			}) 
    	});
    	function subform(){
    		$.post("provider/modifyProvider",$("#editProvider").serialize(),function(data){
				if(data.state==200){
					$.messager.alert('提示','修改成功');
					$("#editProvider").form("reset");
					$("#d").window("close");
					$("#ta").datagrid("reload");
				}else{
					$.messager.alert('提示','修改失败');
				}
			});
    	}
    	function clearForm(){
	    	$("#editProvider").form("load",{
	    	    providerid:"",
	    	    providername:"",
	    	    providerlegal:"",
	    	    providercontinue:"",
	    	    providertel:""
	    	}) 
	    }
    </script>

<form id="editProvider">
		<table align="center" width="60%" >
		     <tr >
				<td colspan="2">
					<input  type="hidden" name="providerid">
				</td>
			</tr>
			<tr >
				<td>供应商名称</td>
				<td>
					<input class="easyui-textbox" type="text" name="providername" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td>供应商负责人</td>
				<td>
					<input class="easyui-textbox" type="text" name="providerlegal" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td>供应商电话</td>
				<td>
					<input class="easyui-textbox" type="text" name="providertel" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td>是否继续供应</td>
				<td>
					<input class="easyui-textbox" type="text" name="providercontinue" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td colspan="2" >
					  <a href="javascript:void(0)" class="easyui-linkbutton" onclick="subform()" data-options="iconCls:'icon-add'">提交</a>
	                  <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">重置</a>
				</td>
			</tr>
		</table>
</form>
